// pages/team/rank.js
import { Team } from '../../model/team.js';
var team = new Team();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    hidden: false,
    team:{},
    user_id: 0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if(options.user_id) {
      this.setData({
        user_id: options.user_id
      })
    }
    wx.showLoading({
      title: '加载中',
    });
    this.getTeamRank();
  },
  getTeamRank() {
    team.getTeamUserRank(this.data.user_id,(res)=>{
      this.setData({
        hidden: true,
        team: res
      })
      wx.hideLoading();
    })
  }
})